home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / TCL1 / __MANDEL / MANDELBR / CMANDELD.H1 < prev    next >
Text File  |  1992-03-27  |  3KB  |  108 lines

  1. /****
  2.  * CMandelDoc.h
  3.  *
  4.  *    Document class for a typical application.
  5.  *
  6.  ****/
  7.  
  8. #define    _H_CMandelDoc            /* Include this file only once */
  9. #include <CDocument.h>
  10. #include <CApplication.h> 
  11.  
  12. class CMandelMap;
  13. class CMandelPhase;
  14.  
  15. typedef unsigned TDwell, **TDwellH;
  16. typedef struct _mandelinfo {
  17.     double    fHOrigin;
  18.     double    fVOrigin;
  19.     short    fWidth;
  20.     short    fHeight;
  21.     short    fDepth;
  22.     double    fScale;
  23.     TDwell    fMaxDwell;
  24. }    TMandelInfo;
  25.  
  26. class CMandelDoc: public CDocument {
  27.  
  28.     public:
  29.     
  30.         void            IMandelDoc(CApplication *aSupervisor, Boolean printable);
  31.         void            Dispose(void);
  32.         
  33.         void            DoCommand(long theCommand);
  34.         void            DoGenerate(void);
  35.         void            DoDraw(void);
  36.         void            Dawdle(long *);
  37.         
  38.         void            UpdateMenus(void);  
  39.     
  40.         void            NewFile(void);
  41.         void            OpenFile(SFReply *macSFReply);
  42.         void            BuildWindow(Handle theData);
  43.         
  44.                                         /** Filing **/
  45.         Boolean            DoSave(void);
  46.         Boolean            DoSaveAs(SFReply *macSFReply);
  47.         void            MakeFile(SFReply *macSFReply);
  48.         void            PickFileName(SFReply *macSFReply);
  49.         void            DoRevert(void);
  50.     
  51.         void            InputTicks(void);
  52.         void            InputMaxDwell(void);
  53.         void            InputRootScale(void);
  54.         
  55.         void            SetMaxDwell(TDwell);
  56.         TDwell            GetMaxDwell(void);
  57.         void            AllocateDwellsHandle(void);
  58.         TDwellH            GetDwellsHandle(void);
  59.         void            ClearDwellsHandle(void);
  60.         CMandelMap *    GetMandelMap(void);
  61.         
  62.         void            SetOrigin(double theHOrigin, double theVOrigin);
  63.         void            GetOrigin(double *theHOrigin, double *theVOrigin);
  64.         void            SetScale(double theScale);
  65.         double            GetScale(void);
  66.         void            QDToReal(Point theQDPt, double *theHCoord, double *theVCoord);
  67.         void            RealToQD(double theHCoord, double theVCoord, Point *theQDPt);
  68.         short            GetWidth(void);
  69.         short            GetHeight(void);
  70.         void            GetMandelInfo(TMandelInfo *);
  71.         void            SetMandelInfo(TMandelInfo *);
  72.         
  73.         void            UpdateSettingsMenu(MenuHandle);
  74.         void            DoImage(void);
  75.         
  76.         CMandelPhase *    itsPhase;
  77.         double            itsHStart, itsVStart;
  78.         short            itsWidth, itsHeight;
  79.         double            itsScale;
  80.         TDwell            itsMaxDwell;
  81.         TDwellH            itsDwellsH;
  82.         long            itsElapsedTicks;
  83.         long            itsRealTicks;
  84.         long            itsFAwakeTicks;
  85.         long            itsFSleepTicks;
  86.         long            itsBAwakeTicks;
  87.         long            itsBSleepTicks;
  88.         double            itsRootScale;
  89.  
  90.         static long        cFAwakeTicks;
  91.         static long        cFSleepTicks;
  92.         static long        cBAwakeTicks;
  93.         static long        cBSleepTicks;
  94.  
  95.     protected:
  96.     
  97.         CMandelMap *    itsMandelMap;
  98.         double            itsHOrigin, itsVOrigin;
  99.         short            itsDepth;
  100.         long            itsImageMapCmd;
  101.         long            itsDwellMapCmd;
  102.         
  103.     private:
  104.     
  105.         static TDwell    cMaxDwell;
  106. };
  107.  
  108.